#include<stdio.h>

int main(){
	double eps,sum= 0,  a = 1;

	int i=1,b = 1;
	
	scanf("%lf",&eps);

	do{
		a = 1.0 * b / (3 * (i - 1) + 1);
		b = -b;
		sum += a;
		i++;
	}while(1.0 / (3 * (i - 2) + 1) > eps);
	printf("sum = %.6lf",sum);
	return 0;
}
